/*     */ package com.zimbra.cs.redolog;
/*     */ 
/*     */ import com.zimbra.common.service.ServiceException;
/*     */ import com.zimbra.cs.account.Provisioning;
/*     */ import com.zimbra.cs.account.Server;
/*     */ import com.zimbra.cs.util.Config;
/*     */ import com.zimbra.cs.util.Zimbra;
/*     */ import java.io.File;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class RedoConfig
/*     */ {
/*     */   private static RedoConfig theInstance;
/*     */   private String mServiceHostname;
/*     */   private boolean mRedoLogEnabled;
/*     */   private static final boolean D_REDOLOG_ENABLED = true;
/*     */   private String mRedoLogPath;
/*     */   private static final String D_REDOLOG_PATH = "redolog/redo.log";
/*     */   private String mRedoLogArchiveDir;
/*     */   private static final String D_REDOLOG_ARCHIVEDIR = "redolog/archive";
/*     */   private long mRedoLogRolloverFileSizeKB;
/*     */   private static final long D_REDOLOG_ROLLOVER_FILESIZE_KB = 102400L;
/*     */   private long mRedoLogRolloverHardMaxFileSizeKB;
/*     */   private static final long D_REDOLOG_ROLLOVER_HARDMAX_FILESIZE_KB = 1048576L;
/*     */   private long mRedoLogRolloverMinFileAge;
/*     */   private static final long D_REDOLOG_ROLLOVER_MIN_FILE_AGE = 30L;
/*     */   private boolean mRedoLogDeleteOnRollover;
/*     */   private static final boolean D_REDOLOG_DELETE_ON_ROLLOVER = true;
/*     */   private long mRedoLogFsyncIntervalMS;
/*     */   private static final long D_REDOLOG_FSYNC_INTERVAL_MS = 10L;
/*     */   private long mRedoLogCrashRecoveryLookbackSec;
/*     */   private static final long D_REDOLOG_CRASH_RECOVERY_LOOKBACK_SEC = 10L;
/*     */   
/*     */   static
/*     */   {
/*     */     try
/*     */     {
/*  43 */       theInstance = new RedoConfig();
/*     */     } catch (ServiceException e) {
/*  45 */       Zimbra.halt("Unable to read redolog configuration", e);
/*     */     }
/*     */   }
/*     */   
/*     */   private RedoConfig() throws ServiceException {
/*  50 */     reloadInstance();
/*     */   }
/*     */   
/*     */   private void reloadInstance() throws ServiceException {
/*  54 */     Server config = Provisioning.getInstance().getLocalServer();
/*     */     
/*  56 */     this.mServiceHostname = config.getAttr("zimbraServiceHostname");
/*  57 */     this.mRedoLogEnabled = config.getBooleanAttr("zimbraRedoLogEnabled", true);
/*  58 */     this.mRedoLogPath = Config.getPathRelativeToZimbraHome(config.getAttr("zimbraRedoLogLogPath", "redolog/redo.log")).getAbsolutePath();
/*     */     
/*     */ 
/*     */ 
/*  62 */     this.mRedoLogArchiveDir = Config.getPathRelativeToZimbraHome(config.getAttr("zimbraRedoLogArchiveDir", "redolog/archive")).getAbsolutePath();
/*     */     
/*     */ 
/*     */ 
/*  66 */     this.mRedoLogRolloverFileSizeKB = config.getLongAttr("zimbraRedoLogRolloverFileSizeKB", 102400L);
/*     */     
/*     */ 
/*  69 */     this.mRedoLogRolloverHardMaxFileSizeKB = config.getLongAttr("zimbraRedoLogRolloverHardMaxFileSizeKB", 1048576L);
/*     */     
/*     */ 
/*  72 */     this.mRedoLogRolloverMinFileAge = config.getLongAttr("zimbraRedoLogRolloverMinFileAge", 30L);
/*     */     
/*     */ 
/*  75 */     this.mRedoLogDeleteOnRollover = config.getBooleanAttr("zimbraRedoLogDeleteOnRollover", true);
/*     */     
/*     */ 
/*  78 */     this.mRedoLogFsyncIntervalMS = config.getLongAttr("zimbraRedoLogFsyncIntervalMS", 10L);
/*     */     
/*     */ 
/*     */ 
/*  82 */     this.mRedoLogCrashRecoveryLookbackSec = config.getLongAttr("zimbraRedoLogCrashRecoveryLookbackSec", 10L);
/*     */   }
/*     */   
/*     */ 
/*     */   public static synchronized void reload()
/*     */     throws ServiceException
/*     */   {
/*  89 */     theInstance.reloadInstance();
/*     */   }
/*     */   
/*     */ 
/*     */   public static synchronized String serviceHostname()
/*     */   {
/*  95 */     return theInstance.mServiceHostname;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static synchronized boolean redoLogEnabled()
/*     */   {
/* 105 */     return theInstance.mRedoLogEnabled;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static synchronized String redoLogPath()
/*     */   {
/* 116 */     return theInstance.mRedoLogPath;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static synchronized String redoLogArchiveDir()
/*     */   {
/* 131 */     return theInstance.mRedoLogArchiveDir;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static synchronized long redoLogRolloverFileSizeKB()
/*     */   {
/* 143 */     return theInstance.mRedoLogRolloverFileSizeKB;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static synchronized long redoLogRolloverHardMaxFileSizeKB()
/*     */   {
/* 155 */     return theInstance.mRedoLogRolloverHardMaxFileSizeKB;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static synchronized long redoLogRolloverMinFileAge()
/*     */   {
/* 167 */     return theInstance.mRedoLogRolloverMinFileAge;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static synchronized boolean redoLogDeleteOnRollover()
/*     */   {
/* 178 */     return theInstance.mRedoLogDeleteOnRollover;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static synchronized long redoLogFsyncIntervalMS()
/*     */   {
/* 198 */     return theInstance.mRedoLogFsyncIntervalMS;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static synchronized long redoLogCrashRecoveryLookbackSec()
/*     */   {
/* 214 */     return theInstance.mRedoLogCrashRecoveryLookbackSec;
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/RedoConfig.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */